package com.ccblife.third.msagent.msagentfeign.rpc;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class DefaultInvocationHandler<T> implements InvocationHandler {

    private Class<T> interfaceType;
    public DefaultInvocationHandler(Class<T> intefaceType) {
        this.interfaceType = interfaceType;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {

        MsagentClient msagentClient=  method.getDeclaringClass().getAnnotation(MsagentClient.class);
        System.out.println( msagentClient.partId()+" " + msagentClient.svrName());
        MsagentClient methodAnn=  method.getAnnotation(MsagentClient.class);
        System.out.println( methodAnn.partId()+ methodAnn.svrName());
       return new DefaultRpcMethodHandler().invoke(args);
    }


}




